{Include file="Include/head" /}
<div class="wrapper wrapper-content animated fadeInUp">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>修改密码</h5>
                    <div class="ibox-tools">
                   	 	<a class="btn btn-success btn-rounded" href="javascript:history.go(-1)">返回</a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form action="javascript:;" method="post">
                    	<div class="col-md-12" style="margin-bottom:10px;">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">原密码：</label>
                                <div class="col-sm-4">
                                    <input type="password" name="old_password" class="form-control" placeholder="请输入原密码" value="" required="required">
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12" style="margin-bottom:10px;">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">新密码：</label>
                                <div class="col-sm-4">
                                    <input type="password" name="new_password" class="form-control" placeholder="请输入新密码" value="" required="required">
                                </div>
                            </div>
                        </div>
                         <div class="col-md-12" style="margin-bottom:10px;">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">重复新密码：</label>
                                <div class="col-sm-4">
                                    <input type="password" name="new_reppassword" class="form-control" placeholder="请再次输入新密码" value="" required="required">
                                </div>
                            </div>
                        </div>
                        <div class="" style="margin-left:20%;">
                            <div class="form-group">
                                <button class="btn btn-primary " id="sub" type="submit"><i class="fa fa-check"></i>&nbsp;提交</button>
                             </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="include/foot" /}
<script>
	$(function(){
		$("#sub").click(function(){
			if($("input[name='new_password']").val().length <6){
				alert("密码最少6位");
				return false;
			}
			if($("input[name='new_password']").val() != $("input[name='new_reppassword']").val()){
				alert("两次密码输入不一致")
				return false;
			}
            var old_password = $("[name='old_password']").val();
            var new_password = $("[name='new_password']").val();
            var content = $(".nicEdit-main").text();
            $.ajax({
                type: 'POST',
                url: "{:Url('Member/check_pwd')}",
                dataType: 'json',
                data : {old_password:old_password,new_password:new_password},
                success: function(data){
                    alert(data.msg);
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
		})
	})
    /*用户-停用*/
    function _submit(obj,id){

    }
</script>
